home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / SphereShift.dxr / Internal_7_g piece.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  3.4 KB  |  112 lines

  1. property spriteNum, RowNum, ColNum, myColor, pImage
  2. global grid, CLRS
  3.  
  4. on beginSprite me
  5.   pImage = sprite(spriteNum)
  6.   RowNum = GetGridRow()
  7.   ColNum = GetGridCol()
  8.   myColor = symbol(sprite(spriteNum).member.name)
  9.   grid[RowNum][ColNum][1] = new(script("game pieces"), spriteNum)
  10.   CLRS[symbol(grid[RowNum][ColNum][1].myColor)] = CLRS[symbol(grid[RowNum][ColNum][1].myColor)] + 1
  11. end
  12.  
  13. on GetGridRow me
  14.   if (pImage.locV >= 26) and (pImage.locV <= 60) then
  15.     return 1
  16.   else
  17.     if (pImage.locV >= 60) and (pImage.locV <= 95) then
  18.       return 2
  19.     else
  20.       if (pImage.locV >= 95) and (pImage.locV <= 130) then
  21.         return 3
  22.       else
  23.         if (pImage.locV >= 130) and (pImage.locV <= 165) then
  24.           return 4
  25.         else
  26.           if (pImage.locV >= 165) and (pImage.locV <= 200) then
  27.             return 5
  28.           else
  29.             if (pImage.locV >= 200) and (pImage.locV <= 235) then
  30.               return 6
  31.             else
  32.               if (pImage.locV >= 235) and (pImage.locV <= 270) then
  33.                 return 7
  34.               else
  35.                 if (pImage.locV >= 270) and (pImage.locV <= 305) then
  36.                   return 8
  37.                 else
  38.                   if (pImage.locV >= 305) and (pImage.locV <= 340) then
  39.                     return 9
  40.                   else
  41.                     if (pImage.locV >= 340) and (pImage.locV <= 375) then
  42.                       return 10
  43.                     else
  44.                       if (pImage.locV >= 375) and (pImage.locV <= 410) then
  45.                         return 11
  46.                       end if
  47.                     end if
  48.                   end if
  49.                 end if
  50.               end if
  51.             end if
  52.           end if
  53.         end if
  54.       end if
  55.     end if
  56.   end if
  57. end
  58.  
  59. on GetGridCol me
  60.   if (pImage.locH >= 27) and (pImage.locH <= 61) then
  61.     return 1
  62.   else
  63.     if (pImage.locH >= 61) and (pImage.locH <= 96) then
  64.       return 2
  65.     else
  66.       if (pImage.locH >= 96) and (pImage.locH <= 131) then
  67.         return 3
  68.       else
  69.         if (pImage.locH >= 131) and (pImage.locH <= 166) then
  70.           return 4
  71.         else
  72.           if (pImage.locH >= 166) and (pImage.locH <= 201) then
  73.             return 5
  74.           else
  75.             if (pImage.locH >= 201) and (pImage.locH <= 236) then
  76.               return 6
  77.             else
  78.               if (pImage.locH >= 236) and (pImage.locH <= 271) then
  79.                 return 7
  80.               else
  81.                 if (pImage.locH >= 271) and (pImage.locH <= 306) then
  82.                   return 8
  83.                 else
  84.                   if (pImage.locH >= 306) and (pImage.locH <= 341) then
  85.                     return 9
  86.                   else
  87.                     if (pImage.locH >= 341) and (pImage.locH <= 376) then
  88.                       return 10
  89.                     else
  90.                       if (pImage.locH >= 376) and (pImage.locH <= 411) then
  91.                         return 11
  92.                       else
  93.                         if (pImage.locH >= 411) and (pImage.locH <= 436) then
  94.                           return 12
  95.                         else
  96.                           if (pImage.locH >= 436) and (pImage.locH <= 471) then
  97.                             return 13
  98.                           end if
  99.                         end if
  100.                       end if
  101.                     end if
  102.                   end if
  103.                 end if
  104.               end if
  105.             end if
  106.           end if
  107.         end if
  108.       end if
  109.     end if
  110.   end if
  111. end
  112.